﻿@using NotWindowsStore.Models
@model AppViewModel

@{
    ViewBag.Title = "Upload App";
}

<h2>Upload App</h2>

@using(Html.BeginForm(null, null, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary()
    @Html.HiddenFor(app => app.AppId)

    <fieldset>
        <div class="editor-label">
            @Html.LabelFor(app=>app.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(app=>app.Title)
            @Html.ValidationMessageFor(app=>app.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(app=>app.CategoryId)
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(app => app.CategoryId, (IEnumerable<SelectListItem>)ViewBag.Categories)
            @Html.ValidationMessageFor(app => app.CategoryId)
        </div>        

        <div class="editor-label">
            @Html.LabelFor(app=>app.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(app => app.Description)
            @Html.ValidationMessageFor(app => app.Description)
        </div>

        <div class="editor-label">
            AppX
        </div>
        <div class="editor-field">
            <input type="file" id="AppX" name="AppX" size="23"/>
        </div>

        <div class="editor-label">
            Cer
        </div>
        <div class="editor-field">
            <input type="file" id="Cer" name="Cer" size="23"/>
        </div>

        <div class="editor-label">
            Image
        </div>
        <div class="editor-field">
            <input type="file" id="Image" name="Image" size="23"/>
        </div>

        <input type="submit" name="submitButton" value="Submit" />
    </fieldset>
}
